package com.raccoonagents.tools.cascet2d.model.stage;

import java.util.Collection;

import org.lwjgl.opengl.GL11;

import com.raccoonagents.tools.cascet2d.interfaces.IRenderableStageElement;
import com.raccoonagents.tools.cascet2d.interfaces.IUpdateable;


public class Layer extends Root {

	@Override
	public void update() {
		final Collection<IRenderableStageElement> allChilds = getElementsRecursive();		
		for(final IRenderableStageElement child : allChilds){
			if(IUpdateable.class.isAssignableFrom(child.getClass())){
				((IUpdateable)child).update(); 				
			}
		}			
	}

	@Override
	public void render() {
		GL11.glLoadIdentity();
		for(final IRenderableStageElement object : children){
			object.render();
		}
		
	}
	/*
	@Override
	public float getWorldRotation(final float rotation) {
		return rotation;
	}*/

}
